/**   
 * @Title: Apiclinet.java
 * @Package com.hxd.love.api
 * @Description: TODO(用一句话描述该文件做什么)
 * @author 谢会超   
 * @date 2015-8-12 下午1:15:40
 * @version V1.0   
 */

package net.bblot.lottery.api;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import net.bblot.lottery.api.task.HttpTask;

/**
 * @ClassName: ApiClinet
 * @Description: TODO(用于封装异步请求)
 * @author 谢会超
 * @date 2015-8-12 下午1:15:40
 * 
 */

public class ApiClinet {

	private final static String TAG = "ApiClinet";
	private static ApiClinet apiClinet;
	private ExecutorService exu;
	
	
	public static ApiClinet getInstance() {
		if (apiClinet == null) {
			apiClinet = new ApiClinet();
			apiClinet.exu=Executors.newFixedThreadPool(4);
		}
		return apiClinet;
	}

	public void doHttpTask(HttpTask ht,
			final SimpleResponseListener listener) {
		Future ft = exu.submit(ht);
		listener.requestCancle(ft);
	}
	
	

}
